#include "widget.h"
#include "ui_widget.h"
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QFormLayout>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QLabel* label1 = new QLabel(this);
    label1->setText("姓名：");
    QLineEdit* edit1 = new QLineEdit(this);
    QLabel* label2 = new QLabel(this);
    label2->setText("年龄：");
    QLineEdit* edit2 = new QLineEdit(this);

    QFormLayout* layout  = new QFormLayout();
    layout->addWidget(label1);
    layout->addWidget(edit1);
    layout->addWidget(label2);
    layout->addWidget(edit2);
    this->setLayout(layout);
}

Widget::~Widget()
{
    delete ui;
}

